# 数据库模块CMake配置
set(DB_SOURCES
    db.cpp
    connection_pool.cpp
    crud_operations.cpp
    transaction.cpp
)

# 创建库目标
add_library(db ${DB_SOURCES})

# 包含目录
target_include_directories(db
    PUBLIC 
    ${CMAKE_CURRENT_SOURCE_DIR}
    ${CMAKE_SOURCE_DIR}/include
)

# 链接依赖库
target_link_libraries(db
    PUBLIC
    Poco::Data
    Poco::Foundation
)

# 安装规则
install(TARGETS db DESTINATION lib)
install(FILES 
    db.h
    connection_pool.h
    crud_operations.h
    transaction.h
    DESTINATION include/db
)